import type {
  RootState,
  RootDispatch
} from "@/types/store"

import {
  useSelector,
  useDispatch,
  TypedUseSelectorHook
} from 'react-redux'

// 定义带类型的 useSelector
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector

// 定义带类型的 useDispatch
export const useAppDispatch = () => useDispatch<RootDispatch>()